import React from 'react'
import Taro, { useDidShow } from '@tarojs/taro'
import { View, Text, Textarea } from '@tarojs/components'
import { Observer, useLocalStore } from 'mobx-react'
import { adviseModel } from '@/model/AdviseModel'
import { ButtonEle, ButtonType } from '@/components/Buttton'

import './index.scss'


export default () => {

  const store = useLocalStore(() => adviseModel)
  useDidShow(() => {
  })

  return (
    <Observer>
      {
        () =>
          <View className="xxm-advise">
            <Textarea
              className="xxm-advise__textarea"
              placeholder="请写您的意见和建议"
              onInput={(e) => store.setValue('content', e.detail.value)}
            />
            <ButtonEle
              type={ButtonType.PRI}
              block
              onClick={() => store.crete()}
            >
              提交
            </ButtonEle>
          </View>
      }
    </Observer>
  )
}
